package com.aspose.cells;

class zth {
   private Workbook a;
   private zok b;

   zth(zok var1) {
      this.a = var1.a;
      this.b = var1;
   }

   void a(zcfx var1) throws Exception {
      var1.b(true);
      var1.b("Properties");
      var1.a("xmlns", (String)null, "http://schemas.openxmlformats.org/officeDocument/2006/custom-properties");
      var1.a("xmlns", "vt", (String)null, "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes");
      CustomDocumentPropertyCollection var2 = this.a.getWorksheets().getCustomDocumentProperties();
      int var3 = 2;

      for(int var4 = 0; var4 < var2.getCount(); ++var4) {
         DocumentProperty var5 = var2.get(var4);
         if (var5.getType() != 5 && !"_PID_LINKBASE".equals(var5.getName().toUpperCase()) && !var5.c()) {
            this.a(var1, var5, var3++);
         }
      }

      var1.b();
      var1.d();
      var1.e();
   }

   private void a(zcfx var1, DocumentProperty var2, int var3) throws Exception {
      var1.b("property");
      var1.a("fmtid", "{D5CDD505-2E9C-101B-9397-08002B2CF9AE}");
      var1.a("pid", zase.y(var3));
      boolean var4 = var1.h();
      var1.c(false);
      var1.a((String)null, "name", (String)null, var2.getName(), true);
      var1.c(var4);
      if (var2.isLinkedToContent()) {
         var1.a("linkTarget", var2.getSource());
      }

      String var5 = "lpwstr";
      String var6 = null;
      switch(var2.getType()) {
      case 0:
         var5 = "bool";
         var6 = var2.toBool() ? "true" : "false";
         break;
      case 1:
         var5 = "filetime";
         var6 = ((DateTime)var2.getValue()).a("yyyy-MM-dd\\THH:mm:ss\\Z", com.aspose.cells.b.a.c.za.b());
         break;
      case 2:
         var5 = "r8";
         var6 = com.aspose.cells.b.a.zr.a(var2);
         break;
      case 3:
         long var7 = var2.e();
         if (var7 < 2147483647L) {
            var5 = "i4";
         }

         var6 = com.aspose.cells.b.a.zr.a(var2);
         break;
      case 4:
         var6 = com.aspose.cells.b.a.zr.a(var2);
      }

      var1.b("vt:" + var5);
      var1.a(var6);
      var1.b();
      var1.b();
   }
}
